m <- leaflet() %>% setView(lng = -71.0589, lat = 42.3601, zoom = 12)
m %>% addTiles()
data(quakes)
head(quakes)
## lat long depth mag stations
## 1 -20.42 181.62 562 4.8 41
## 2 -20.62 181.03 650 4.2 15
## 3 -26.00 184.10 42 5.4 43
## 4 -17.97 181.66 626 4.1 19
## 5 -20.42 181.96 649 4.0 11
## 6 -19.68 184.31 195 4.0 12
tree_df = read_csv("./data/2015StreetTreesCensus_TREES.csv") %>%
janitor::clean_names() %>%
filter(status == "Alive", health == "Good")
## Parsed with column specification:
## cols(
## status = col_character(),
## health = col_character(),
## zipcode = col_integer(),
## zip_city = col_character(),
## boroname = col_character(),
## Latitude = col_double(),
## longitude = col_double()
## )
# Show first 20 rows from the `quakes` dataset
leaflet(data = tree_df) %>% addTiles() %>%
addCircleMarkers(~longitude, ~latitude,
stroke = FALSE, fillOpacity = 0.5)